﻿namespace Furesoft.Styling.Converters
{
    using System;
    using System.Drawing;
    using System.IO;
    using System.Net;

    internal class ImageConverter : IConverter<Image>
    {
        #region Public Methods and Operators

        public override Image Convert(string s)
        {
            Stream str = null;
            if (Function.IsFunction(s))
            {
                Function f = Function.Parse(s);
                str = (Stream)Function.ResolveClrFunc(new Functions.ImageFunctions(), f);
            }
            return Image.FromStream(str);
        }

        public override string Convert(Image s)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}